To transfer Pokemon from Diamond, Pearl, Platinum, Heartgold, or Soulsilver to Black, White, Black 2, or White 2, you need to find the Poke Transfer Lab on Route 15 in B/W/B2/W2. You'll also need to have two DS systems. (The type doesn't matter.) Now do as told below.
>By using the Nintendo DS's Download Play, a player can send six Pokémon from a Generation IV game to a Generation V game of the same language. The player will then participate in a mini-game in which they must capture the Pokémon using a bow that shoots special Poké Balls. There is a time limit, and if all six Pokémon are not captured within the time limit, the Pokémon not captured will be sent back to the Generation IV game, while those that are caught will be sent to the Generation V game, allowing fewer than six Pokémon to be sent at a time. The player has no limits on how many Pokémon they can transfer a day. Like Pal Park, Pokémon sent over cannot be returned to any Generation IV game.
Now, to transfer Pokemon from Black, White, Black 2, or White 2 to X, Y, Omega Ruby, or Alpha Sapphire, do as told below.
>Log onto the 3DS eShop to download the Pokemon Bank app for free. [...] Launch the copy of whichever game it is you want to transfer Pokemon out of (e.g., Black/White or Black 2/White 2), not the Transporter app, and fill up Box 1 in your PC with the Pokemon you wish to move into X/Y. [...] Anyway, now that your Pokemon are in Box 1, save your game and exit. Launch the Poke Transporter with said game still physically inserted in your system, and you'll be asked to transfer those Pokemon to the Bank's Transport Box temporarily. [...] From here, it's time to exit the Transporter app. While on the 3DS home screen, remove your copy of Black/White or Black 2/White 2 and insert (but don't start) Pokemon X/Y. Now, you'll want to start the Bank app. Finally. Once you confirm that you want the Bank to access X/Y, you'll see a familiar sight with Box 1 from X/Y on the lower screen and Bank 1 on the top screen. Scroll the cursor up to the Bank 1 label and press left -- this will take you to that Transport Box containing the Pokemon transferred in via the Poke Transporter. Now you can either move these Pokemon into a different area of the Bank for safe keeping (up to 3,000 Pokemon can be stored at once), or you can move them into X/Y. Almost done.
Hope this helps!