In a medium pot over moderate heat saute garlic and mushrooms in extra-virgin olive oil for 2 or 3 minutes. Add zucchini and onion to the pot and season vegetables with salt and pepper. Saute another 5 minutes. Add beans, cumin, tomato and chopped rosemary. Bring stew to a bubble, reduce heat to low and simmer 10 minutes.
Heat a nonstick skillet over medium high heat. Add a thin layer of olive oil or vegetable oil to the pan, just enough to coat the bottom. Combine potatoes with onions and flour. Mix in shredded cheese. Spoon piles of potato and cheese mixture into the pan, making 3-inch rounds, 1-inch apart. Cook cakes until golden and crispy, about 4 minutes on each side. Remove cooked cakes and repeat process.
Arrange cakes, 3 per person, on dinner plates and top with ladles of mushroom and zucchini stew.