The reality of it isn't all that exciting. The Windows API provides hook procedures that basically do the work for you. To catch keyboard events you could use the 'LowLevelKeyboardProc' Function:
http://msdn.microsoft.com/library/de...yboardProc.asp
You can access the Win32 API from a number of languages. I wont be telling you how to hide from Task Manager, though. If you have to ask, then you probably don't need to know.