You have not mentioned the model of the printer. Please try these steps:

(a) Uninstall the printer, the software and delete all the printers from the System32/spool folder.
(b) Download the latest drivers from http://www8.hp.com/us/en/support-drivers.html
(c) Restart the computer.
(d) Install the downloaded drivers.
(e) Run a Windows Update.
(f) Connect the printer and let windows detect it.