Barry,
The example code from the zip file Sergei posted should already be on your system, as it is one of our installed VisaNS examples. You should find it on your computer at "C:\Program Files\National Instruments\MeasurementStudioVS2003\DotNET\Examples\Visa\VisaicNS." The other example programs there might help you get started as well.
All of the instrument connection types you listed share a common base class called MessageBasedSession. This base class should provide all of the functionality you need to perform reads and writes with your device. Also, we provide a factory class called ResourceManager for exactly the case you've described, where you don't know until runtime the exact session class you need. A simple example would look something like this:
//assumes that resource name describes one of the connection types you lists - usb, serial, gpib, ethernet, etc.
using (MessageBasedSession mbs = (MessageBasedSession)ResourceManager.GetLocalManager().Open(resourceName))
{
mbs.Write("*IDN?");
string idQueryResponse = mbs.ReadString();
}
You could pull the value of the resourceName variable from your user interface and use it to construct the session. From that point, regardless of the actual type of connection you're using, you should be able to work with the MessageBasedSession reference to perform I/O.