Recently the Interoperability Bridges and Labs Center released a prototype implementation (in managed code) of two drafts of the WebSockets protocol specification:
draft-hixie-thewebsocketprotocol-75 and draft-hixie-thewebsocketprotocol-76
The prototype can be found at HTML5 Labs. I put in this blog post all the information I found (until now) and snippets of code about how this can be done using WCF.