With tomatoes its really important to rotate your crop. I let the chickens dig over the vege beds before planting as well, they eat any nematodes in the soil, as well as black beetle larvae.
I've found that planting marigolds does the trick, and even making a tea of marigold leaves and flowers, and pouring this into the bed before planting, gets rid of those pesky 'todes :)