This is a hard one to answer, and one that my group went over a lot in the past few years.
The answer is complicated. The shield descriptor indicates that a medium shield may be used to make an "offhand" attack only (although part of this depends on how you read this language -- does that mean you *can't* use a shield to make a main-hand attack?).
However, this really borks feats such as shield charge. Are you constrained to making an offhand attack at the end of a shield charge when that's your only attack for the round?
Further, it makes using even a medium shield brutal. You take all the offhand penalties for using a medium-sized weapon offhand if you slam with a medium shield.
In my opinion, the shield attack rules are borked. I would permit the following:
You can make a SINGLE attack in a round with any weapon you carry IN EITHER HAND as a "main-hand" attack, and not suffer the penalties for fighting with two weapons.
Thus, if you make a SINGLE attack with a medium shield (i.e. shield charge), you do not suffer the offhand penalties or the penalties for fighting with two weapons.
You may not wield a shield with two hands.
If you attack with more than one weapon in a round (i.e. make use of the extra attacks from fighting with two weapons), you suffer all penalties as usual, and the additional offhand penalties for fighting with a medium-sized weapon in the offhand.
very best,
Carpe