Timber warehouses and wholesale distributors are the main suppliers to builders, but the products offered are different. Sawmills provide approximately three-quarters of builders with dimensions and design wood, plywood, OSB and household wrap. Sawmills also supply reinforcement, molding and carpentry to more than half of the builders. There are many large supplier companies in every city.
You can search for providers on Google for your local area. Although Home Depot and Lowes cater to smaller contractors with bulk orders. Large supplier companies allow anyone to place an order, although sometimes the size of the order does matter. It is one of the largest commercial suppliers of residential building materials %26 in the New York metropolitan area.
Some suppliers have a scale, with greater discounts for high-volume contractors. On the other hand, if you act as your own general contractor, you will need to arrange for the purchase and payment of a wide range of materials. Every city I've worked in has a private logging company and that's usually who contractors will deal with. For some things, or because of location, builders will deal with the big retail chains, but even there the builder will usually get a contractor discount due to volume and repeat business.
Working for a contractor for a long time, I know that larger contractors try to avoid Lowes and Home Depot as much as they can. I would like to add that a contractor or subcontractor would normally purchase several materials from several specialized suppliers.