Well, looking at the 'compost' in the pot, its obviously full of decaying matter - the creatures you're seeing appear to be millipedes, which feed on decaying matter. They don't cause trouble in open ground, but a population as high as this in a pot isn't desirable.
First, you need some decent potting mix, so if you've got some already, you can proceed now to deal with the problem. Turn the plant out of its pot, get off all the soil you can (and millipedes), and if there's still lots left round the roots, soak the rootball in a bucket of water till you're able to gently extract the roots from the remaining soil. While you're waiting, wash and sterilize the pot, or use another, clean pot. When all the soil's gone, repot using the clean, (preferably good quality) potting compost. As you've exposed all the roots, put a layer of compost in the bottom of the pot, checking the level isn't too high, and dangle the roots of the plant above the compost, so the bottom ones are sitting on the compost, spread them out a bit, and then keep adding soil, gently pushing it around the roots as you go, until you're up to the crown of the plant. Firm down gently, water thoroughly, allow to drain down.