In a food processor coarsely puree beans and tomatoes. Leave some aside if you like a more chunky style soup.
In a 6 qt. heavy-bottomed pan (I like cast iron)cook the onion, shallot, garlic, cumin, salt and pepper in butter over medium heat until onion is softened and beginning to brown.
Stir in bean/tomato puree, followed by broth, pumpkin and sherry.
Simmer uncovered, with occasional stirring for25 minutes or until thick enough to coat the back of a spoon.
Just before serving add ham and vinegar totaste, simmer again until heated through. Add salt and pepper to taste
Serve with sour cream and pumpkin seeds.