Do a search on this site for X-52. Many posts explaining what you need.
BUT, just go in joystick set up and scroll down the list and find pitch trim and the other trim. Map it to the "rotary1" and Rotary2" respectively. The make sure to save the setup before exiting out.