BeagleBone as USB gamepad HID

I was wanting to build a homemade gamepad or HOTAS using a BeagleBone Black or Pocket. It will be written in C++. I was wondering if there are any libraries that will let me use the board as a USB HID client for this purpose. Also would I be able to just use a USB A to A to the already onboard USB A port, or do I need to wire up to some pins.