Well to rule out the simple first...
If using a wireless mouse and/or keyboard, check the batteries. When the batteries run low, this causes the mouse pointer to act erratic and the keyboard to lose connection. It fails slowly on some however, so can be really annoying, jumpy and your questioning what's wrong at first.
If using a laptop ensure your palms are hovering the mouse touchpad while typing.
I know it sounds stupid, but easy to do and overlook, lots of people do it. You could use FreezeTouch to prevent this:
http://code.google.com/p/touchfreeze/downloads/listNow if it's not the simple things - are you using an USB or PS/2 keyboard and mouse. Is it wired or wireless?
Are the drivers (Microsoft so helpfully picked with it's plug n pray feature) incompatible with the device?
Are you using sticky keys or keyboard shortcuts?
Rule out some of the basic, then you can freak out about malware like Allan suggests.