Yes they will gain the EVs as long as a Pokemon gains EXP in a battle, it will receive the EVs. Say, for instance, you're EV training Hit Points. You attach your EXP. Share to your level 1 Chansey and begin fighting the Bidoof trainer south of Solaceon Town. Chansey would receive EXP after each Bidoof is defeated, so she will receive 1 EV in HP every time a Bidoof is defeated. After the battle is over, Chansey would have received 5 EVs in HP.
Now, if you attached another EXP. Share to, say, a Machop, both Chansey and Machop would receive 5 EVs in HP after the battle since they both earned experience. If they had the PokeRus, that EXP would be doubled.
Basically, if a Pokemon earns EXP from a battle, it will receive the EVs related to the defeated Pokemon's EV stat.