Im far from a Printer expert and probably someone can tell you exactly what to do.. But anyway I'll give it a try

.
- Install the TCP/IP printing service (under network settings).
- Edit services in control panel, look for TCP/IP printservices make sure it starts with the computer.
- Add a new printer HP 5M in your case.
- Add a new hardware port (LPR) the settings would be somthing like.
name : ip adress to the jetdirect box
port : RAW1 (or whatever u have the printer connected to).
Continue the installation of the printer.
To add and change a setting on the Jet Direct box you'll need the software for that. Should be bundled with teh box and can maybe be found on HP's website.
This can be wrong since I dont know much about the hardware u use, but I hope it'll help

.
~micael