That RKBA can go both ways. It says the people have the right to be armed as part of the militia. However, the militia, being military, is controlled by the state which, it seems to me, can tell them to be unarmed. Sorting that out could keep the courts busy for years.
The right to keep and bear arms isn't subordinate to the concept of a militia. The Virginia Constitution recognizes it as a right. It further states that the reason it shall not be infringed is because of the necessity of a militia (militias need men with arms).
It's like saying "A well fed population is necessary for a strong militia, which is necessary for the security of a free state, therefore the right of the people to eat shall not be infringed."
This statement doesn't suggest that your right to eat is in any way dependent on your membership in a militia. It just states the public policy justification behind prohibiting the infringing of that right.