Blanch them first, then quickly submerge in ice water to cool them down completely before popping in the freezer. I've had struggles with mushy frozen corn on the cob, but others have had good luck - I think there are tricks to that as well, can't recall what they are offhand.