For sending and recieving byte throught serial port of the COM u need to have null modem cable connected via MAX 232 to ur 89C51.
For programming u need to decide first baud rate u want to communicate with.
According to ur working frequency calculate count to be kept in counter.
Counter has to be kept in such mode that it will interrupt after count reached FF.
On PC side open hyper Terminal with same baud rate setting.
I think this will give u the outline of what u want.