Both are correct.
Only once in a blue moon will Mr. Smith let us get out of class early.
Inversion is used correctly, will is moved to the front of the subject Mr. Smith
Only once in a blue moon, Mr. Smith will let us get out of class early.
Original form of the first sentence, of course this is correct!
Hope this helps ;)