Preheat the oven to 180°C, gas mark 4. Lightly butter a small roasting tin about 20x26cm and line with baking parchment. Using a peeler, cut the courgette into long ribbons. Heat the oil in a frying pan, add the ribbons and cook quickly for 2-3 minutes until just wilted. Remove from the pan.
Blend the cornflour to a smooth paste with a little of the milk, then add the remaining milk. Whisk the eggs in a separate bowl, then add the milk mix. Stir in the ham hock and season.
Pour the mix into the prepared tin, and scatter over the courgette ribbons and tomatoes. Dot teaspoonfuls of pesto over the top, and sprinkle with the cheese.
Bake for 30 minutes until just firm to the touch and browned. Cool in the tin for 10 minutes before cutting into squares to serve.