By invert I mean using the bitwise compliment (~) of the variable, so ~255 = 0, and ~0 = 255.
When set as outputs, the I/O pins on a microcontroller can source or sink current depending on the potential of what is connected to them. The PWM is switching your arduino pin continually between 0v and 5v, so if an LED with 5v on its anode has its cathode lead connected to the PWM pin, current will flow into the pin when it is at 0v, and no current will flow when it is at 5v since the potential is equal.
edit: Just saw your edit, glad to see you got it working.