Preheat the oven to 350F. Grease a 1½ quart casserole dish with butter and set aside.
Add the butter to a medium skillet over medium heat. Once melted, add the onion and cook until softened, but not browned, about 6 to 8 minutes, stirring occasionally. Transfer to a large bowl and cool slightly.
Once the onions are cooled a bit, whisk in the eggs, cream, and vanilla. Sift in the flour, cornmeal, sugar, baking powder, salt, and black pepper, just to combine (be careful not to over mix). Fold in the corn.
Pour the batter into the prepared dish and bake until set and golden, about 35 to 40 minutes.