It's definitely a case of matching what you eat.
When eating somthing like a pizza, for example, it's unlikely that your body will absorb the starch very quickly due to the fat content, and you might not eat the whole pizza, so I find it best to inject as I finish eating.
If I eat slow release carbs, I should probably delay the injection too, as I sometimes find myself hungry straight after eating in these cases.
The only time when I can reliably inject before eating is, controversially, when eating a dessert. Even though desserts tend to be high fat, the sugar generally counteracts the normal effect of fat. Also, when eating a regular lunch like a sandwich, crisps and a piece of fruit, I inject before and don't normally get any problems.
My last bit of advice: if switching from Lantus to Levemir, you may get odd BG readings for a bit as I've found the doses don't quite match up all the time, and they react differently to certain foods. Lantus, for instance, seems to tolerate beer better with me (I don't drink very much beer).