I've never used that type of gun, but getting it to work should be similar to getting Aimtrak to work (since Windows already can see it.) Being a CHD game or not shouldn't have any effect.
Check the settings, and make sure you turn on lightgun input and offscreen reload (and probably mouse input too.) Lightgun input is a separate setting that was added a while back.
Go in the game, and turn on your cursor [tab button]. If the cursor moves, you're all set. If not, use Tab to go into Input (for that game), and change Lightgun X Analog by moving the gun back and forth. Do the same for Y, and your trigger for P1 Button 1.
Sorry if this isn't very good instructions, in a bit of a hurry. Maybe someone else can clarify anything I left out.