Boldore might be a bad example because it actually gives off 1 Attack and 1 Defense EV.
All Pokemon that play a part in the battle (even if they don't attack and switch out right away) will get the same base EVs. Pokemon with Exp. Share get the same amount of EVs as if they were battling.
So if your Pokemon has Pokerus and Exp Share it would double EVs, i.e. 2 Atk, 2 Def from Boldore.
If you have Pokerus and are holding the Macho Brace then you get 4 Atk, 4 Def EVs from Boldore.