Hooking up the DS to a wireless router isnt that difficult. Its exactly the same process in which you would add a laptop/ Wireless PC to the network. Search for it, enter the security key (if needed) and away you go. it simply uses the internet connection to connect to the nintendo servers.
As for the friend codes. There are games such as Mario Kart that allow you to play online. Each Individual game has its own "Friend Code". Though you dont need one to play online, it allows you to play against people that you know, otheriwse your competition is allways random or matched against your success profile.
How you go about getting a friend code is quite simple, one is generated for you the first time you play the game online. It is generated through the combination of the mac adress of your individual DS and the Game Card itself.
Here is a great step by step guide that explains it much better than I can if you are still stuck...
http://www.nintendowifi.co.uk/customersupport/SupportHome.jspFAQ
http://www.nintendowifi.co.uk/consumerservice/showFAQCategory.do