When you deploy the ejb the container generates the stub classes for you and also creates the classes that implements the EJBHome and EJBObject.
These are proxy classes (Proxy
pattern) and has code to communicate(marshalling and unmarshalling) with the corresponding EJBObject and EJBHome classes.
So during run time when a client make a call to the proxy object it communicates with the cooreponding Remote EJBObject and EJBHome to transfer the call.
When you remove the Bean by calling remove on the EjbObject or home interface the Bean is destroyed (Stateful Session Bean) the EJBObject is destroyed and they are ready for garbage collection.
However there is no gurantee that the corresponding stub and home stub is also destroyed in the client but if you try to call methods on them you will get
java.rmi.NoSuchObjectException(Remote) javax.ejb.NoSuchObjectLocalException