2 rows 9 pins D-SUB 9 (or Cannon 9) connectors were used on PC for serial COM ports (RS232) and in even older days also for IIRC EGA/CGA monitor connection.
My bet is that it's the serial port (you can check with multimeter if GND is on the right place - IIRC pin 5). Serial port uses male Cannon 9 connector on the PC side and female connector on the cable (or device if plugged directly) which matches your description.
Nowadays machines do not usually have RS232 any more, so in such case you need a USB to RS232 or USB 2 COM port adapter first which might be a big problem on W9x with drivers for it and also the cheap ones might not work at all with your device... there were also ISA alternatives. Any decent IDE card had RS232, GAME and LPT on-board but again having ISA on modern machine is luxury (even PCI these days) unless you have a developer machine style motherboard (these are quite expensive but have "all" the old stuff onboard).
Now if you run W9x program on Win7 it means you have 32bit OS version (on x64 you can not run 16bit apps any more) which is fine but problem is W9x drivers are not compatible with win7. And also RS232 does not have any notion of VID/PID so you have to select/install correct driver manually. NEVER USE automatic driver install for it - Windows will almost always choose wrong driver.
If your device is old and discontinued and not very common you will have most likely no chance of getting win7 compatible driver (there are online driver writing services out there just for these cases, but it's not for free. IIRC it was called driverguide or something like that; formerly it was database of old drivers so if you are in luck it might contain what you need already).
So I would try some emulator or virtual machine similar to DOSBOX to run Win9x virtually inside your Win7 (beware that MS Virtual PC does not work on Win7 correctly; it was my favourite up to XP as it was really simple small and free, but after they ported it to Win7 it's unreliable and crashes a lot). There are quite few of them out there like WMware; just google it. After that run your app inside it with the old drivers installed there too. It should work normally as on real machine if the emulator supports COM port forwarding...
If all fails, you could try to reverse the communication protocol yourself as RS232 COM port serial communication is pretty easy (just file access - you do not even need a driver). However you would need some stuff about the device yourself (ideally capture the data between old machine and device during usage) and then either create your own app for using the device or somehow inject the data into the Win9x app (similar to what DOSprint does). However you never described what the device is ...