Preheat the oven to 200 degrees C. Put the dried porcini mushrooms and 1 cup (250ml) of the milk in a small saucepan. Bring just to the boil, then remove from the heat and set aside to soak.
Heat the oil and spread in a wide saucepan over a medium heat. Add the celery and cook gently, stirring occasionally, for 3–4 minutes or until softened. Increase the heat, add the chestnut mushrooms and cook, stirring, for about 3 minutes.
Add the flour and cook, stirring, for 2 minutes. Gradually add the remaining milk and cook, stirring well, until the mixture just comes to the boil and thickens.
Strain the porcini mushrooms, reserving the milk. Add the milk to the mushroom and celery sauce. Bring back to the boil, stirring. Coarsely chop the porcini and add to the pan. Simmer for 2 minutes, then add the lemon juice and season with pepper to taste.
Pour the mushroom sauce into a shallow ovenproof dish and spread out in an even layer. Scatter the beans on top. Set aside.
In a heavy saucepan, cook the polenta in the boiling water, or according to the packet instructions, until it is thick. Remove from the heat and briskly stir in the eggs and about half of the grated parmesan. Season with pepper to taste.
Pour the polenta mixture over the mushrooms and beans. Sprinkle the remaining parmesan cheese over the top. Bake for about 20 minutes or until the filling is bubbling and the top is lightly browned. Serve hot.