I meant DMG page 29, not MM. Sorry about the needless confusion.
Creatures that have a reach of 0 feet can't flank an opponent, because they don't threaten the squares around them.
When making a melee attack, you get a +2 flanking bonus if your opponet is threatened by an ally on the opponent's opposite border or opposite corner. Only a creature that threatens your foe can help you gain a flanking bonus.