I am using this image from another post, which is why it has lines drawn on it that are useful for only a small aspect of this question:
According to the stealth rules, you need cover in order to make a stealth attempt. According to the Combat rules, PFSRD - Combat (see the cover example #2 in the link), both A and B have melee cover with respect to each other, but not ranged cover (assuming neither is using a weapon with the reach property that can also attack an adjacent square, such as a spiked chain). So, ranged attacks do not grant cover bonuses, but melee attacks do? Could the melee cover be considered cover for the purposes of allowing a stealth roll? I was thinking of it like, A presses his back against the wall, turns the corner and shoots an arrow directly into B's face, granting sneak attack damage if the stealth roll is successful.
Initially, I thought this made sense. However, the fact that A's cover depends entirely on B's weapon choice seems peculiar. If B is holding a spiked chain, A no longer has cover with respect to B. If that were true, it is almost like B's spiked chain increases B's perceptive abilities. Alternatively, maybe stealth was never possible in this scenario at all.
Another possibility is that the spiked chain does not negate the melee cover they each have against each other, so stealth is still possible. The fact that B does not happen to be holding a weapon that is affected by the cover does not negate the cover itself.