The HP site had much info on this. Check there if you have not. But be sure to search for "Macintosh HP Drivers." This will bring up a list of Q&A on how to make those printers work on an iMAC. (i.e. don't plug into the keyboard)
Unfortunately I have alot of experience with the Epson's, and not much with HP's on the iMac. If the stuff off the HP site doesn't work, try Apple's onlines support or better yet, there are some great online sources for help that are free. You just have to look around.
Best of luck.