Okay, so that's roughly 40 gallons and 8 gallons respectively.
I like the 8 gallon for a shrimp tank, but am not crazy about such a small tank for fish, unless you had perhaps a single betta.
The 40 gallons, you have tons of opportunity. You want species that will occupy all three levels of the tank, so as to utilize the "real estate" wisely.
Bottom level, I would recommend 6 kuhli or 3 yoyo loaches.
Middle-lower level, I would recommend a large school of rummynose tetras, maybe 10 of them.
Upper-middle level, perhaps a gourami or a pair of bolivian rams.
What I did with my first community was hit the lfs with a pad and pen and wrote down the names of all the species I really loved. Then, I went home and researched and by the time I was ready to stock my tank, I did it properly with species that were compatible.
Most importantly, don't forget to read up on cycling your tank, prior to purchase:
http://www.aquariumadvice.com/forum...started-check-out-these-resources-154837.html