Hit TAB while in the game. Select Player 1 left, hit enter. Then spin your spinner to the left. Then select Player 2 left, hit enter. THen spin your spinner to the right.
As pointdablame says, that doesn't work (at least not in MAME32 0.84u1).
Does not work for any mame. Only works for mice with the analog input of analog ports in mame versions after ~0.85.
If I tap the optic sensors, I can (theoretically) decode the signal into left & right clicks (with each click being a transistion).
Easy to translate:
00 <-> 01 <-> 11 <-> 10 <->
00 (repeat)
^^
| \ - Sensor 1
|
\--- Sensor 2
Only "hitch" is sometimes going left in above sequence is spinning left, sometimes going right in above is spinning left. But mame can handle that.
I can see three ways to transform those clicks into button/key presses:
1. Each click is a press, possibly with an RC delay.
2. Extending that, as long as the spinner goes in the same direction above a certain rate the button is held down.
3. More of a positional. So if you spin 10 degrees right, the right button is held down. This could be done using up/down counters.
This is the hard part.

But I agree with NoOne: Spinners convey much more info than left/right. Finding the "best" way to lose that info will vary from spinner to spinner, and user to user, and game to game. Just use a joystick in the first place.