Well granted they're solving quadratic equations, but neither are the adults.
For instance, if you expose larvae a rewarding stimulus like sugar along with an odour, they will later be attracted to that odour. That is by definition learning, simple learning, but we have to start somewhere i guess.
Interestingly there is some evidence that the memory lasts through to the adult stage, despite the fact that a lot of the brain is actually rewired during pupation.