Preheat oven to 350º F. Remove outer layer of papery skin from the two garlic heads, leaving the skin intact around individual garlic cloves. Using a sharp knife, cut 1/4 to a 1/2 inch from the tops of the cloves. Place them on a sheet of foil and drizzle about a tablespoon of olive oil over each head. Sprinkle salt over the tops. Wrap the foil around the heads to make a sealed package. Roast for 35 minutes. After removing garlic from oven to cool slightly, increase heat to 400º F.
In the meantime, combine water, yeast, and the sugar in the bowl of a standing electric mixer. Stir to dissolve and let stand until it becomes foamy, about 5 minutes. Add 2 cups of the flour, the salt, and olive oil and mix to combine with a wooden spoon. Add remaining flour, about 1/2 cup at a time, mixing until a thick, sticky dough forms.
Using the mixer's dough hook, knead the dough until smooth and slightly sticky, about five minutes. Scrape the dough into a lightly oiled bowl and let it rest, covered, for about 30 minutes.
Turn the dough out on a lightly floured work surface and divide it in two. Shape each piece into a tight ball and let them rest, covered with plastic wrap, on a floured surface for about 20 minutes.
In the meantime, prepare the toppings. Squeeze garlic cloves from their papery wrappings. They will not feel done, but don't worry -- they'll continue roasting as the foccacia bakes. Slice any especially large cloves. Set aside.
Flatten each ball of dough into an 8 to 9-inch round about 1/2 to 1 inch-thick. Transfer them to parchment-lined baking sheets sprinkled with cornmeal.
Using your fingertips, poke indentions across the surface of each round. Drizzle about 1 tablespoon olive oil over the surface of each one and spread it evenly over the top. Sprinkle cheese over the olive oil before adding garlic and rosemary. Drizzle several tablespoons of olive oil over the surface of each loaf and then sprinkle them generously with kosher salt.
Bake until golden brown on top and bottom, about 30 to 35 minutes. Serve warm.