Place rack in the center of the oven and preheat to 350 F.
Combine 6 tablespoons sugar, 3 tablespoons water, and the rosemary in a 10 inch ovenproof skillet with an 8 inch-diameter bottom. Stir over medium heat until the sugar dissolves. Raise the heat to medium-high and cook, without stirring, until the caramel is golden amber. Remove the skillet from the heat and whisk in 2 tablespoons of butter.
Peel, halve, and core the pears. Cut them lengthwise into ¼ inch thick slices. Arrange the slices, overlapping slightly, on top of the caramel in the skillet.
Whisk the flours, cornmeal, baking powder, xanthan gum, and salt in a small bowl to blend.
5. Using an electric mixer, beat the remaining 6 tablespoons butter with ¾ cup sugar in a large bowl until light and fluffy. Beat in the vanilla extract. Add the egg yolks, one at a time, mixing well after each addition. Add the flour in three additions, alternating with two additions of the milk.
In a separate bowl, with clean beaters, beat the egg whites on medium speed until they form soft peaks. Fold ¼ of the egg whites into the cake batter, mixing until just incorporated. Add the remaining egg whites, folding until just blended.
Pour the batter over the pears and smooth out the top.
8. Bake the cake until the top is golden and a tester inserted into the center comes out clean, about 45-50 minutes. Let the cake cool for 15 minutes. Run a butter knife around the skillet. Place a large plate atop the skillet. Using oven mitts, hold the plate and skillet together and invert the cake. Rearrange pear slices if necessary. Serve warm with whipped cream, if desired.