First off, what is happening to you is not right. You are correct to be angry about it. Talking to the manager or owner would be a good idea. However, I think I can explain why you get these reactions.
First, gun stores are very much a "good ol' boy" network. If you're not male, white and over 40, you will not automatically be given respect. They are still one of the most politically incorrect businesses in existence.
Young people are their biggest time wasters. In their experience, they come in after 2,000 hours of Call of Duty and want to "play" with the real guns. Their salespeople waste time showing gun after gun with no chance of a sale.
If the store is in a questionable or transitioning area, the staff may wonder about gang affiliations of anyone under 30. Again, this is not fair, but if they have had to deny sales to younger people or they've been the victim of gang activity, they may have some prejudice.
Now, none of these are your fault, they are preconceived perceptions on the part of the staff. But you can lessen the chance that they will treat you this way by doing a few simple things:
Dress responsibly. Leave your hoodie, baggy pants and flip flops at home. You don't need to wear a suit, but clean jeans that fit, a polo shirt and nice shoes will make you look upper middle class, meaning you are serious and have the ability to buy.
Walk to the counter, engage a salesperson and make a simple, declarative statement. Salespeople don't care if you are just looking, but they will take you more seriously if you tell them exactly why you're there. "I have my concealed carry permit, and I am ready to buy, I just haven't found exactly the right gun." Or, "I'm just browsing for a home defense gun, but I'm not sure I'm ready to buy. Would you mind suggesting something?" These statements show respect for his position and let him know exactly where you stand. He can now choose to devote his time to you (ready to buy) or help you in-between other customers (browsing).
Don't have a chip on your shoulder. We all have been treated with ignorance and sometimes downright stupidity by salespeople. However, the way you handle it says volumes. If a salesperson asks if you've ever handled a gun, just smile and say, " All my life" or "I'm just learning." Some are being a smarta$$, but others may be trying to determine what you would like better. Not every question is an indictment of you or your skills.
Be loyal. If you win over one salesperson, the rest of the staff will come around quickly. You will have a store that respects you. Everyone knows that "cash talks and BS walks" so if you find a good deal on a gun, call or visit the same store and give them the chance to match price. Tell them while your there, "I found this deal over at Gun Buddy, but I always buy through you guys first." Customer loyalty is well-rewarded these days of Internet undercutting local stores.
Of course, there is always the salesman that is just bad. If he doesn't start to come around even when you are reasonable, it may just be time to move on. As the popular saying goes, "You can't fix stupid." Just make sure to inform the store owner or manager that you're taking your business elsewhere and why.
This is about a relationship, and when you first walk in, they don't know you from Adam. Show them you are responsible, serious and loyal and you will never be treated like a time-wasting, trash-taking gangster again!