Use a touchscreen as a keyboard and mouse for a desktop
Solution 1:
There are many Virtual Keyboards you could use for this purpose.
Some options:
Windows has a built-in one called On Screen Keyboard.
Mac OS X can use a Dashboard widget. There may be a built-in one, but I'm unaware of it.
Linux in general has many different programs, typically matching their desktop environments and often included as part of the distribution. A popular one for GNOME is Florence.
Ubuntu, at least several versions ago, came with one called onboard
There is a (proposed) program called Virtual Touchpad that, funnily enough, allows you to use a virtual touchpad. Unfortunately, it looks like an abandoned project with no real work done. There is no shortage of phone or tablet applications that provide similar functionality, however, as Lèse majesté points out.
The problem with trying to find such a program (aside from the utter rubbish that Google comes up with when searching for this) is most people tend to use a touchscreen directly, not with an indirect virtual touchpad. Of course, if you could get your OS to recognise your screen overlay as a tablet, that may help. It would probably make virtual keyboard use more difficult, however. (By tablet I mean the input device, not the underpowered computers/oversized phones.)
Solution 2:
Bob's suggestion is probably best for keyboard, but if you want to use an Android touchscreen device as a mouse, you can use RemoteDroid or premotedroid. Each requires a server app you run on your computer as well as the Android app client that you run on your phone/tablet.
As I understand it, you can only use the touchscreen as a laptop-style touchpad, not as an actual tablet device (i.e. you can't map the device to an area of the screen and draw on the tablet like a digitizer tablet), but you can at least use it as a mouse substitute.