I wouldn’t....are the tiny maggots very shiny and white? like this?
you need to scroll down https://www.rhs.org.uk/advice/profile?PID=234
because vine weevils are nasty. In any case I would probably dispose of the soil and use new
Think about it ... last years compost is full of last years roots. It was used to give nutrients and food to last years plants. The only thing you should do with it is put it on the compost heap and smash it up .. or scatter it in your borders.
This years seeds and plants require new compost to give you good results ... get rid of it as woof says, it is harbouring pests.
if the maggots are vine weevil then I wouldn’t put it on the garden or compost heap, I would bag it and put it out with the rubbish or take it to the tip.
Vine weevils are one of the few garden inhabitants I will wage all out war on because they can wreck a garden, especially containers, in the space of a year. The other two are mosquito larvae and lily beetles.