From the Pokémon Trainer Club newsletter. If you do not already have an account, register on Pokemon.com and make sure to set your email preferences in your profile to receive the newsletter on October 20th. This appears to be the only way to receive a demo code in America.
To receive the newsletter, make an account at Pokemon.com, and set your preferences to receive newsletter.You should then receive the newsletter on October 20th.
To redeem the code, open up the EShop, go to the menu button in the top left corner, and select Redeem Download Code, and enter your code.