I have friends from all different backgrounds and social classes. I let the invitation be my guide. If the invitation was printed especially for the event or if it was a blank card with an art print on the front, I take as a dressy occasion. If it was purchased in bulk and/or is funny or cutesy, I interpret that as a more casual party. If the party is at some sort of clubhouse, I dress better. If there is any indication that the hostess went above and beyond the call of duty, I dress better. It is disconcerting when one goes to all the trouble or ironing linens, polishing grandmother's silver, and using a special cleanser to make the crystal punchbowl shine and then have the guests arrive dressed extremely casually.
That said, I would've made you feel just as welcome no matter how you were dressed. I would've also taken any guest aside who treated you coolly or distantly. Breach of hospitality is a faux pas in any culture.
In my family we usually buy the invitations in bulk but showers are slightly dressy (generally no jeans, but nice pants, skirts, dresses are all fine). But as you said, if someone showed up in something else, we wouldn't make them feel bad. My aunt and I were cohosting my cousin's bridal shower (my aunt's niece, not daughter) and my aunt's daughter (also my cousin of course, just trying to clarify the relationships
) was around 13 or 14 and was planning to wear jeans and a baggy t-shirt (and not horrible jeans, but not really nice jeans either). She wasn't listening to my aunt's suggestions that she change and when I got there to help set up, solicited my opinion on what my cousin was wearing. I said I didn't care, but if I was her I wouldn't wear that because she'd be by far the most casual. Apparently cousins are less annoying than mothers and she listened to me and changed her clothes and fit in much better. If she'd stayed stubborn, no one would have cared much, but I think she would have been uncomfortable.