Depending on how sophisticated you want to get you can do one of the following:
If it's a console app (i.e. black dos box style). Use getch()
If it's a windows app handle WM_KEYUP / WM_KEYDOWN
In either you can put in some DInput and get a lot of control over the keyboard.