This is actually quite simple as Mac OS X Tiger and later ships with a VNC Server built-in. You have the choice of Screen Sharing, which is more basic approach or Remote Management which will give you a lot more control over the machine.
Enable Screen Sharing / Remote Management
Go to System Preferences and select the Sharing option.
Select Screen Sharing or Remote Management, I will select Remate Management for this post, but it’s pretty much the same thing with less options. You can setup a password under Computer Settings while other options such as Restart and shut down are under the Options menu.
PS: Apple’s VNC Server uses port 5900. More information