This is a pretty good example of hosting a service from a Winforms application.
http://www.codeproject.com/KB/WCF/WCFexample.aspx
You could also do something simple like this in your main method:
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
ServiceHost host = new ServiceHost(typeof(TestService));
NetNamedPipeBinding namedPipe = new NetNamedPipeBinding();
host.AddServiceEndpoint(typeof(ITest), namedPipe, "net.pipe://localhost/test");
host.Open();
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new AutoDeployApp());
}
Then, use this type of thing inside the service to get at the running form:
MyForm form = Application.OpenForms["MyForm"] as MyForm ;