I would like to write a master program to control the NXT brick from my pc. I am thinking of using c++ or c# but don't know if there are any libraries or packages available. Does anyone know where there may be some sample code or if the .Net framework comes with Bluetooth libraries?
You'll find a whole lot of libraries and packages for virtually any programming language. The packages however vary greatly in the amount of features they support, their stability, and their documentation.
If you post your requirements, i.e. what you want to do and what things are important to you, we can give advice. Also post your favorite programming environment (does it have to be .net, or are you flexible)?
For .net there are MindSqualls and AForge available (google).
RWTH - Mindstorms NXT Toolbox for MATLAB
state of the art in nxt remote control programming http://www.mindstorms.rwth-aachen.de MotorControl now also in Python, .net, and Mathematica