>In X & Y, there's a special kind of currency that can be earned called PokéMiles. In-game, these are earned by doing a variety of things including trading Pokémon on the GTS, StreetPassing other players, making Wonder Trades and just standard trading. In addition to that, you have the ability to play attractions on the Pokémon Global Link in order to earn PokéMiles.
Seribii. You get to spend them to buy random stuff :3 like rare candies.
Also here is a conversion table for Dream Points to Poke Miles
No idea how they're calculated in the other ways :P. I'll put that in if it appears in the next decade or so~