Spell immunity in any form functions as "unbeatable spell resistance". Spell resistance, if you remember, only works against spells which target the creature or which include the creature in the area of effect. Invisibility cast on a PC doesn't directly affect include the golem, so the subject is invisible to the golem. Golems do not have Blindsight, Tremorsense, Scent, or Keen Senses, so they are unable to perceive an invisible (or otherwise concealed) opponent.
As an example of a time when something would occur, consider a 17th level Wizard gates in an Iron Golem and directs it to attack a creature warded with magic circle against evil. Normally, conjured or summoned creatures cannot make physical attacks against such a warded creatrue, but the Golem's spell immunity means he ignores the effect.
This also means that, technically, Golems are vulnerable to any spell which says "Spell Resistance: No". This makes sense, because an Iron Golem attacking a conjured creature doesn't instantly unsummon it, but it also means that an Iron Golem is vulnerable to a maze spell (and would be trapped for 10 minutes as it would not attempt to escape because it could not be instructed to). Still, I think this rather violates the spirit of "Spell Immunity", so is probably no how it should work. The same can be said of Rakshasas and other blanket spell-immune creatures.