New Scientist released an awesome article describing how researchers are using rat brains to control a robot. Approximately 300,000 neurons from a rat fetus are deposited onto a sheet of nutrients and electrodes (and MEA, or multi-electrode array) and the neurons immediately begin to build connections to each other and to the electrodes.
The robot can send signals to the neurons via these electrodes and the neurons will over time fire off in predictable patterns. These patterns can be connected to output electrodes that can send signals back to the robot and cause it to react to its environment, such as avoiding a wall. The video is simply awesome so check it out: