Hi,
Click the Apple icon and select Software Update.
Be sure to install any ovailable os or HP update prior connecting the printer.
Then connect the printer and the driver should install automatically.
If it still fails, Download and install the software below prior connecting the printer and then check if that helps:
http://support.apple.com/kb/DL907