I am confused about creating EJB

I have seen many samples of EJB on the internet and also sample project in which an EJB is developed using SessionBean , EJBObject and the EJBHome interfaces. In some other examples EJB is created without these interfaces and using only one or two interfaces e.g. if its locally accessible, javax.ejb.Local interface is used while for remotely access javax.ejb.Remote is used. 

So i am confused about creating EJB. What is the difference between these two type?

I know that first one is implementing EJB for remote Access but the other one is confusing me

Please Help Me...!!!