It's very important to say what OS are you targeting. I hope you want it only for educational purposes, ideally to learn how to detect them and protect against them, or at least some not-harmful usage.
Though if I was to make a simple one (I almost never use tutorials, instead come up with some way to solve the problems myself), I would do the following:
-Search given OS's documentation for reading raw keyboard input even without focus (should be okay for simple one, but I think it's not so reliable, more complex one might probably try to find a way to detect input at lower levels (inject itself into the kernel if possible? Modify the driver?).
-Look for a way to hide the application from the system (no visible GUI, ideally hide it from process list)
-Decide what exactly I want to capture and how I'll store it. Do I want to store also some additional information about the computer? Do I store raw scancodes or decoded key codes (that's usually affected by keyboard layout)?
-Write a code that would capture the keyboard input and store it somewhere (would harddrive be a good idea? It might be easier to found if it keeps writing on the drive often, so probably large cache in RAM?)
-Look up some libraries for network communication
-Write a code that would, once in a time (not very often so it's not visible) send the recorded data to given location.
Of course, it's needed to elaborate each of these points, however, when designing application, it's important to decompose it into logical units, each performing certain task.