You're right, for a Remote interface (either home or component) the client will have a reference to a proxy of the EJBObject (or EJBHome) and *not* a reference to the actual object. The client *does* need that class file, but how this happens depends entirely upon your application server (and the environment in which the client is running).
So at compile time, the client needs the interfaces, but at runtime the client needs the interfaces AND the stub classes, but HOW the client gets the classes will vary...
The most straightforward, and perhaps most common way is when the deployment tools generate stub classes, and package them into a "client jar". The client puts this in his classpath, and everything is cool. This client jar may also include the home and component interfaces. Some server/client scenarios can dynamically send the proxy class to the client, in such a way that the client doesn't need to have the stub class physically present prior to runtime.
Remember, the client code is not usually portable, even if the bean is (although that's a good reason to build your client using, say, the ServiceLocator
pattern or something like it). You'll have to find out from your app server exactly what the client must know and have in order to run correctly.
cheers,
Kathy