Jonny MC was almost right, they are Pinnotheres pisum (Linnaeus), commonly called the pea crab and regularly found inside bivalves, especially mussels.
Its not absolutely certain how they get or remain there, however, thoughts may be that they are drawn in as larvae as the mussel draws water into its body cavity (filter feeding), the larvae evades being digested and escapes into the mantle cavity (inside the mussel), it then feeds on the organic material either as a waste product or other larger material drawn in by the mollusc. It then grows to its normal size.
This may be an example of a synergistic relationship in that the pea crab plays a role of housekeeper, it also may protect the inner soft tissue against other predators such as parasitic copepods, however, in the long term the pea crab does have a deleterious effect on the bivalve by causing gill erosion. This has a knock on effect by reducing filtration (feeding capacity), leading to weight loss and poor conditioning and reduced spawning potential.
As a result the relationship between the mussel (bivalves) and the pea crab is as yet unresolved between parasitic or commensalism.