The error message you had before 'error inserting 'g_hid.ko': -1 No such device.' is due to incomplete hid gadget driver. You can followDocumentation/usb/gadget_hid.txt
to add your own platform device portion.

For your reference, the following patch is what I tried and it works with the 3.3 kernel from the link I provided above with SD card boot.