Preheat the oven to 475°F. Cut the heads of garlic in half crosswise and place on a sheet of aluminum foil. Drizzle the olive oil over the tops and fold the foil up around the garlic to seal. Roast for about 1 hour, until the garlic cloves are soft and lightly caramelized. Remove from the oven and let cool slightly.
Remove the garlic from the foil and squeeze the cloves into a blender with the vinegar, heavy cream, rosemary, parsley, and sugar and blend until smooth. Season with salt and pepper, to taste. Pour the sauce into a large skillet and place over low heat.
Meanwhile, bring a large pot of salted water to a boil. Add the pasta and cook for 4 to 5 minutes, until al dente. Using a slotted spoon, transfer the pasta to the skillet with the garlic sauce and toss gently to combine. Add the cheese and toss again to coat.