I wrote this a little while back to do some tests on BNLS. it doesn't do any connections to bnet, it just connects to bnls server and sends a 7D packet. its really basic, but i thought it might be something good for a beginner to read.
http://www.mikeownage.com/downloads/sourcecodes/bnlstest.zip
http://www.mikeownage.com/downloads/sourcecodes/bnlstest.zip