If you are using two light guns, you may want to try installing the Aimtrack configuration utility on this site
You probably tried this, but make sure your mame.ini has the lightgun enabled (lightgun '1'). The following is taken from my mame.ini
# CORE INPUT OPTIONS
Aside from that, make sure your lightgun trigger (I.e. Button 1) works on the windows desktop (before you start Mame). Then start Mame to see if the trigger (button 1) is recognized,
Also before doing any of the above, you may want to reset your Mame to it's default (Options-->Reset to Default). then try playing around with the settings.