Hi babu!!
You can not call the server.createobject on client side with onunload event.
Alternatively you can call your specific web page and from that page you can call it(c++) object within the server.
I think you want to trap the browser close button and update some statistic to the server.
following link will help you at some extent.
http://p2p.wrox.com/topic.asp?TOPIC_ID=1774
and also read the trick provided by Imar
hope this will help you
Cheers :)
vinod