I think you are refering to 'rotary joysticks'.
Head over to
www.happcontrols.com, click on amusement>joysticks>rotary & optical joystick.
You are right in both of your suggestions, there is an optical one and a mechanical one. You can hook the optical one up using Happ USB interface, mouse hack etc. and for the mechanical type you need Druins Interface (sorry don't have the url).
Ikari Warriors, Heavy Barrel & some other SNK games use the mechanical type - I'm not sure which games use the optical type (maybe Caliber 50). I believe you can use either of these joystick types to control all of these games in MAME tho. They are usually classed as 'dial' games by MAME I believe.
Hope this helps