1. Preheat the oven to 350 degrees.
2. Heat the olive oil in a large skillet over medium heat. Add the zucchini, eggplant, carrots, onion, and garlic and cook, stirring, for 10 minutes.
3. Transfer the vegetables to a food processor, add the remaining ingredients, except the walnuts, and process until smooth, or chop fine with a knife. Mix in the walnuts.
4. Transfer the vegetable and walnut mixture to a 14 X 9 X 2-inch oiled baking dish and bake it until bubbly, about 30 minutes. Serve hot as a dip. Imam will keep, tightly covered, in the refrigerator for 5 days.