Checkout this file: https://github.com/jdaigle/servicebroker.net/blob/893a2d9c6a6ef6aed9c1d05dc6a253183a5d7470/ServiceBrokerDotNet/ServiceBrokerWrapper.cs
It's a small wrapper around the T-SQL calls that I wrote. The community samples that other mentioned are more complicated than it needs to be.