Optical properties of hydrogenated graphene and Fe/GaAs(001) from first principles