Pulled out a random USB gamepad - works, but you generally need to make sure the mappings in USB preferences make sense. In the list on the bottom/left on the config window you'll see a 'Sensors' entry and you generally have to try and fix this by hand. Most joysticks have a totally bogus HID descriptor (they fix it by installing Windows filter drivers)...
To check what the sensors API sees on the other side, download and run https://tunkki.dk/~jaca/waitandhid utility.
I've also just tested an XBox 360 Wireless pad and an XBox One pad using waitandhid and they both work correctly. There's some issue with the 2 analog triggers in the 360 pad, so I'll make sure to correct that. The rest works just fine.
@BSzili
I'll try to review your code soon...
Anyway, I recommend using XBOne/360 or PS4 gamepads and not the crappy random USB stuff.