Download Atmel Studio 6 and check out the examples (integrated into the Studio). If I remember correctly there even is an example for HID Devices.
Of course there is a fully implemented USB stack available upon which you can still build upon.
Furthermore, there are examples for various other USB devices (Mass storage, ...)
You might also want to refer to the following application notes:
http://www.atmel.com/Images/doc8446.pdf - USB Device (HID Keyboard)
http://www.atmel.com/Images/doc8499.pdf - USB Device (Generic)
The USB documentation is pretty terrible. It suffers from excessive genericization, where they're trying to make everything so generic and general that it's hard to get from the docs to any specific application.
The descriptor format is located in the document called "Device Class Definition for HID" at the link to usb.org you provide.
The critical thing you're missing is that the various segments (such as 0x05) is not documented with the prefix 0x. In fact, they generally describe them in raw binary.
For example, with regard to the 0xA1:
You can see that the binary prefix 1010_00nn
indicates that is is a collection, and the postfix nnnn_nn01
indicates it is 1 byte long. Then subsequent byte is then interpreted as the collection type, in this case of type Application. This then sets the context in which the further bytes are interpreted, untill the HID descriptor parser either sees another collection tag, or an end collection marker.
You can see that END COLLECTION
is specified as 0b1100_00nn
, with nn
being ignored. This is where the 0xC0
is coming from.
You can also start to see how the other arguments are constructed. For example, LOGICAL MINIMUM
is 0x25
, or 0b0010_0101
. From that, we can see that we have a data-length of 0bnnnn_nn01
, or one byte, and the specifier for LOGICAL MINIMUM
is 0b0010_01nn
The structure for the USAGE PAGE
descriptor is the same. The command to select the usage page is 0000_01nn
, and nnnn_nn01
indicates it is 1 byte long. I would guess that, since the documentation states that usage-pages are 32 bits, the upper bits are assumed to be zero, or inferred from another part of the documentation. I actually don't know how they're specified.
There is a good page of the various HID constants here.
And a more recent version from the BSD sources here (Thanks, @crazysim!) (latest HEAD, may not last).
Best Answer
There is Gamepad Companion, and ControllerMate that let you configure the USB HID to keyboard presses, but they don't have a display like the windows tool. Some of the Xbox HID drivers do, but only for the xbox controllers.
If you just need to see when the buttons on your hid device are pressed, you could use Snes9x, map them to the buttons in the controller setup, and it will display what buttons are pressed when you press them. Doesn't display any axis information.
Edit:
HID Wizard
has a visual setup as well. Again, no axis information.Dolphin
the gamecube/wii emulator does have axis information, but geared towards a gamecube like controller.Afaik, there is no random/arbitrary hid profile display like the windows tool.