Prebake pie dough in pie plate according to package instructions, then remove from oven and reduce temperature to 350°F.
Meanwhile, halve leeks lengthwise and cut crosswise into 1/2-inch pieces, then wash well in a bowl of cold water, agitating leeks.
Lift out and drain leeks in a colander and pat dry. Melt butter in a 10-inch heavy skillet over moderately low heat and cook leeks, stirring occasionally, until very tender, 8 to 10 minutes.
Line warm pie shell with sliced ham, overlapping layers as necessary to cover bottom and side of pie shell completely. Toss cheeses together and sprinkle evenly into pie shell (do not pack cheese), then spread leeks evenly on top of cheese.
Whisk together eggs, nutmeg, and pepper until combined well, then whisk in crème fraîche until smooth.
Carefully pour half of custard on top of pie filling, gently moving cheese with a spoon to help custard disperse evenly.
Slowly add remaining custard in same manner. Cover pie loosely with foil, gently folding edges over crust (keep foil from touching top of cheese mixture) and transfer to a baking sheet.
Bake until center of filling is puffed and set (center will be slightly wobbly but not liquid), about 1 1/4 to 1 1/2 hours. Cool on a rack at least 20 to 30 minutes before serving (filling will continue to set as it cools). Serve warm or at room temperature.