Once you've completed the game Pokémon Black Version 2, head over to route 15 (east of Nimbasa City). There you'll come across the Poké Transfer Lab. This is where you can transfer Pokémon from generation 4 (which includes Pokémon from Diamond/Pearl/Platinum/HeartGold/SoulSilver) to Black/Black 2/White/White 2 if you have 2 DS systems.
IMPORTANT! YOU CANNOT TRANSFER POKEMON IF THE LANGUAGE/REGION OF THE 2 GAMES DIFFER (for example: Dutch/English version of HeartGold and a German/American version of Black 2)
The regions and languages are as follows: English (Europe), German, French, Japanese, English (American), Chinese, and Italian.
You can transfer them via Download Play. However, you'll need to play a mini-game first to obtain them.
Tip: make sure to place the Pokémon you want to transfer in an empty PC box (not in your party, as you won't be able to transfer them).
Ps: The transferred Pokémon CANNOT be brought back to the original game.