it happened to me also...
I use XP, Mame32.
the first time I open Mame32, the joysticks and buttons don't work.... but then if I close it and re-open Mame32, then everything works fine....
donno why....
try closing the pgrm, do NOT reboot, then re-open the pgrm again... see if that works....