If using fresh corn, cut the kernels off the cob and set aside. If using frozen corn, thaw it and drain any excess water.
In a large saucepan, melt the butter over medium heat. Once melted, add the flour and stir with a whisk for about 1 minute to create a roux.
Gradually whisk in the heavy cream, ensuring no lumps form. Cook for 2-3 minutes, allowing the mixture to thicken slightly.
Add the cream cheese, cheddar cheese, and Parmesan cheese to the saucepan. Stir continuously until the cheeses are fully melted and combined.
Season the cheese sauce with garlic powder, onion powder, salt, and pepper. Adjust the seasoning according to your preference.
Add the corn kernels into the cheese sauce and stir until evenly coated. Cook for an additional 5-7 minutes, until the corn is heated through.
(Optional) Transfer the cheesy corn mixture to a baking dish and sprinkle a bit more cheddar cheese on top. Broil for 3-5 minutes until the top is bubbly and golden brown.
Remove from heat, garnish with fresh parsley if desired, and serve warm.