I couldn't find anyone who had figured out how the "Atari Arcade for iPad - Duo Powered" by "Duo Games", so I did. The item number of this Joystick is 04-0002EN. It was built by Discovery Bay Games.
You can get the Atari Duo fairly cheap now that 30pin iPads/iPhones are considered "old". Check out http://www.amazon.com/Atari-Arcade-iPad-Duo-Powered/dp/B0062H2KNK
This works on iOS5+, so it will work with your first Generation iPad. :-)
The code is fairly self explanatory. It demos how to detect when the gamepad is connected, getting the status of all the buttons, and how to handle data in various ways (like a cheat code).