Kohn-Sham theory for orbital dependent exchange-correlation energy functionals: Application to the calculation of ionization potentials and electron affinities