1) First thing you need to do is to make sure that the 2 computers are on the same workgroup (Vista is called WORKGROUP by default and XP is called MSHOME - you can name them whatever you want to).
Do this by right clicking computer, properties and then computer name.
2) Run the network setup wizard on the XP machine, turn on file and print sharing and restart that.
3) Next on the VISTA pc you need to make sure the network you have created is set to private, so network discovery can be established.
4) Have a look through both computers firewall settings and make sure you allow file and print sharing and that you trust the network.
That should be all the steps you need to set it all up. Just go to START and then NETWORK and the XP machine should appear.
If you want to connect to the printer, you can just navigate on the VISTA machine,to the network connections, find the XP machine and then find then find the printer, right click and click connect. It might ask you to install the drivers and just press accept.
Just in case when you find the printer over the network and try to connect to it you get an error message:
what you need to do is install the printer on the vista machine with a local port (just so vista has got a correct driver, as xp does not hold drivers for vista), then go to printer port properties and create a new local port and use the path to the printer as the name for that port (ie \\192.168.2.3\hpprint) or whatever else the printer is named.
also use the computer name rather than its ip address as ip address might change