It's usually used for scrolling navigation in handheld devices. You can figure out the pins by reading the datasheet or simply using a multimeter to find out what they do when you operate it.
I use two thumbwheel switches to select stall/service tracks for a model railroad roundhouse and turntable. Here is how to read the two switches using a PicAxe controller with the switch commons tied to + voltage.