For the wiring, see
this post (#28 in that thread). Also scroll down to post #40 there.
In a nutshell, you need to keep the power and illumination connections to your factory head unit (HU) and HVAC controls, and also connect your new HU to power and your car's speakers.