Green function approach to realistic calculations of the electronic structure of semiconductor interfaces