Rinse the dried beans. Place in a large pot and cover with 3 times as much water as beans. Bring to a boil. Reduce heat and simmer for two minutes. Turn off the heat and let the beans stand, covered, for 1 to 2 hours. Drain.
In a large pot, sauté onions in olive oil. Add the beans and cover with water, allowing enough liquid for the beans to expand. Add the diced ham, celery, carrots, garlic, tomato paste and bay leaf. Simmer for about 2 hours (less if using canned beans).
When the beans are tender, add salt, pepper, white wine and enough water to cook the pasta.
About 10 minutes before serving, bring the soup to a boil. Add the pasta, diced zucchini and pesto. Cook until the pasta is al dente. If the soup is too thick, add additional water.
Serve topped with grated parmesan cheese and a dolop of pesto.