I have an little older model IPac, it's USB/PS2, but i've only ever been able to program it when it's connected to PS2.
I suspect the newer versions don't have that issue (or maybe it's just my setup).
Once programmed though, works fine connected to USB.