A few games will recognise USB controllers automatically. There are also some utilities on the app store that will let you use a controller with other games by mapping keys or mouse functions to the controller.
I'm using a free app with a generic USB controller and some console emulators at the moment and it works fine. I think there is at least one app that claims to support XBox controllers - but it costs money.
GamePad Companion is what I have been using, along with a generic Mad Catz controller. It was free software when I downloaded it a few years ago - but I just had a look and apparently it now costs money on the app store.
I have been using it OK with some emulators but if you have to pay for it now then I wouldn't recommend it. It doesn't cope very well with anything involving analog controls.