I took the Microsoft Robotic Studio and connected a Mindstorm robot, a notebook and a Wii controller to play with technology.
And now learn how to do it.
The Code for Controlling Robot using Wiimote & MS Robotics Studio
There's a request from the Microsoft Robotics Studio Team to post my code for controlling the robot using Microsoft Robotics Studio (MSRS), Lego Mindstorms NXT, and Bluetooth.
Here are the steps:
1. Buy a Nintendo Wii gamepad (Wiimote) if you don't have a Wii. It will cost you between $40-$70.
2. Buy a Bluetooth dongle with Cambridge Silicon Radio (CSR) or Integrated System Solution Corp (ISSC) radios embedded. This is because not all Bluetooth dongles can communicate with the unique Wiimote. My USB Bluetooth dongle brand is Billionton, so if you have Billionton, rest assured you have CSR radio.
3. Download a trial copy of ISV BlueSoleil here: http://www.bluesoleil.com/products/index.asp?topic=bluesoleil_v5. This is the software stack that works well with the Wiimote. And this software stack only works with CSR-based and ISSC-based radios.
4. Download Microsoft Robotics Studio 1.5.
5. Download Brian Peek's .NET Wiimote Library from CodePlex here.
6. Build the .NET Wiimote Library. Copy the *.dll from \WiimoteMSRS\bin\service to \Microsoft Robotics Studio (1.5)\bin
7. Create a copy of the folder \Microsoft Robotics Studio (1.5)\samples\RoboticsTutorials\Tutorial4\CSharp and rename the duplicate folder "WiimoteTutorial4"
8. Open the "WiimoteTutorial4" solution in Visual Studio. Add a Reference to \Microsoft Robotics Studio (1.5)\bin\Wiimote.Y2007.M06.Proxy.dll
9. Open the file "RoboticsTutorial4.cs". Add a using statement on the top:
1 using wiimote = WiimoteLib.Proxy;
2
Add the following code to the Class member declarations area (after "private drive.DriveOperations _driveNotify = new drive.DriveOperations();")
1 // partner with wiimote service
2 [Partner("Wiimote", Contract = wiimote.Contract.Identifier,
4 CreationPolicy = PartnerCreationPolicy.UseExistingOrCreate)]
5 private wiimote.WiimoteOperations _wiimotePort = new wiimote.WiimoteOperations();
6
7 // maintain the previous state of the wiimote
8 private wiimote.WiimoteState _stateLast = new wiimote.WiimoteState();
9
10
10. Add the following code to the end of the Start() method:
1 // create an internal notification port
2 wiimote.WiimoteOperations _wiimoteNotify = new wiimote.WiimoteOperations();
3
4 // setup to receive WiimoteChanged msgs
5 Activate(Arbiter.Receive<wiimote.WiimoteChanged>(true,
6 _wiimoteNotify, WiimoteChangedHandler));
7
8 // subscribe to the Wiimote
9 Arbiter.Choice(
10 _wiimotePort.Subscribe(_wiimoteNotify),
11 delegate(SubscribeResponseType response) { Log

12 Info("Subscribed to Wiimote service"); },
13 delegate(Fault fault) { LogError(fault); }
14 );
15
16
11. Add the Wiimote Handler method after Start() method:
1 private void WiimoteChangedHandler(wiimote.Wiimote

2 Changed msg)
3 {
4 wiimote.WiimoteState state = msg.Body;
5
6 if (state.AccelState.Y > 0.5f)
7 _mainPort.Post(new Forward());
8 else if (state.AccelState.Y < -0.5f)
9 _mainPort.Post(new Backward());
10
11 // based on threshold, move left/right
12 if (state.AccelState.X < -0.5f)
13_mainPort.Post(new TurnLeft());
14 else if (state.AccelState.X > 0.5f)
15 _mainPort.Post(new TurnRight());
16
17 if (state.ButtonState.A)
18 _mainPort.Post(new Stop());
19
20 // cradled position - stop
21 if (state.AccelState.Y <= 0.5f &&
22 state.AccelState.Y >= -0.5f &&
23 state.AccelState.X <= 0.5f &&
24 state.AccelState.X >= -0.5f)
25 _mainPort.Post(new Stop());
26
27 _stateLast = (wiimote.WiimoteState)state.Clone

28 ();
29
30 }
31
32
12. Right-click the Project Properties. Under the Debug tab, edit the Command Line Arguments to:
-p:50000 -t:50001
-m:"samples/Config/Wiimote.manifest.xml"
-m:"Samples\Config\RoboticsTutorial4.manifest.xml"
-m:"samples\config\LEGO.NXT.Tribot.manifest.xml"
13. Debug your app and control your robot's destiny with your Wiimote 
14. if you want the whole code already written or you have any doubt go and visit my blog here