As Kenny points out, the WCF Core Communications team put together a great set of resources with documentation and samples for writing custom channels for WCF.