First the messenger service must be enabled on the machine(s) you want to send the message to and NetBIOS must be enabled on the network. The syntax is as follows:
net send computer message
You can type just net send in the command prompt and it will give you the full syntax for sending the message. I believe in XP SP2, the messenger service is disabled by default due to security reasons but you can re-enable it in the services snap-in.