Yes, you can use a class library for a WCF service (there's a project in Visual Studio under WCF for WCF Class Library). This class library would hold the implementation of the service contract - the service contract could be defined in the class library as well, or could be in another assembly that the class library references.
This class library then in turn needs to be hosted (IIS, self-hosted or Windows Service). We do this at work - we have an n-tier application that uses WCF to communicate between the layers, and all of the services themselves are implemented in a class library, and hosted (usually in IIS, in one case in a Windows Service).
Taking a modified version of your posted code (you should have different names for you implementing classes and your DTOs), you could do something like this:
Class Library
[ServiceContract]
public interface Interface1
{
[OperationContract]
Class1 GetClass1(int id);
[OperationContract]
Class2 GetClass2(int id);
}
public class Service1 : Interface1
{
public Class1 GetClass1(int id)
{
// implementation
}
public Class2 GetClass2(int id)
{
// implementation
}
}
Note that there is one service class, and it implements the two Operation Contracts defined in the service definition (Interface1). You code as posted would not compile because neither class implemented both methods defined in the interface (you would also get at the very least a warning on the class names because of their return types as well).
You could then add a reference to this class library to the assembly you have your DTOs (Class1 and Class2) in.
To host this in a self-hosted scenario or a Windows service you would need a reference to the class library (Service1 in my example) and a reference to the DTO assembly as well. Then you would instantiate a service host for the service, like this:
baseAddress = new Uri("some address");
ServiceHost myHost = new ServiceHost(typeof(Service1), baseAddress);
myHost.Open();
To host in IIS, you'd modify the .svc file markup like this:
<%@ ServiceHost Language="C#"
Service="MyCompany.Service1"
Factory="System.ServiceModel.Activation.ServiceHostFactory" %>
You'll want to fully qualify the service name with the complete namespace, so assuming the namespace for Service1 was MyCompany the fully-qualified name would be MyCompany.Service1.
Finally, you will need to put the relevant system.serviceModel section in the corresponding hosting application's app.config or web.config file, as libraries use the config files of their consuming application, not their own.
There's a number of subtle variations on this theme (in our case, we use a custom service host and custom service host factory, and the interfaces - service contracts - are in a separate assembly, which allows us to create proxies via ChannelFactory<T>.
To answer your final question, the class library(ies) will have to reference the assembly that contains your DTOs if they are going to use them, and you can split your service class libraries however you deem fit for your requirements - I would definitely split them at least by layer, and possibly by vertical stack as well, if you have multiple applications.