I apologize for spoiling your fun, but it does not sound like a good project. For one thing, there is this Launchpad bug report which sounds very similar to yours indeed. Second, there is a possible solution on the ever helpful Arch Linux wiki: it is recommended that you enable EHCI Hand-off
in your BIOS settings.
If it is indeed a bug, or a misconfiguration of the BIOS settings, it is hardly a matter to be solved by writing a good driver. My personal inclination is that it is a matter of BIOS setting (will you let me know?) because this German fellow reports using exactly your generic keyboard without a hitch in 2006. He displays the output of
cat /proc/bus/input/devices ....... I: Bus=0003 Vendor=05c7 Product=2012 Version=0001 N: Name="Generic USB K/B"
which is exactly your keyboard as reported by
[ 1.543402] hid-generic 0003:05C7:2012.0004: unknown main item tag 0x0
As for the meaning of the error messages, I can help you only partially: hid-generic is a driver for HID-compatible peripherals. HID (=Human Interface Device) is a protocol for the specification of input/output devices assuring compatibility of components across different computers. You can find a good intro to HID here.
You were searching for an (advanced!) C project: you may then hunt down the error messages you find in the code of the hid-generic
driver I referenced above. I am too lazy to do it myself.