Probably by plugging it in USB port and running the game. But with keyboard is much faster to place traps. You don't need to summon the item wheel then the trap wheel each time you want to place a trap.
For games that natively support 360 controllers, it is best to use x360ce and create a profile for your non-360 controllers.
Under downloads on the left, download the file that comes with the "app" (.exe file). Run the file and let it give you a couple errors about some missing files which it creates. Let it scan for pre-defined profiles. If it fails to find one, use the drop down menu on the bottom of the program to find the closest match, if any. Customize the rest of your controls (might take some trial and error) Hit save on the bottom right when you're done. Exit Copy the 2 files that were created (x360ce.ini, xinput1_3.dll) *Save them somewhere where you can access them in the future (to avoid re-doing the profile for another game later on)* Copy the files to Dungeon Defenders\Binaries\Win32
When you start the game you should hear a beep confirming it worked. You can do the same for other games by copying those same 2 files in the .exe folder of the game.
Some older controllers might require an extra tweak to the .ini file after you create it, but most recent controllers work fine. Just do a google search if you have any problems.