There are two kinds of corn, sweet corn and dent corn. They're genetically quite different, they're grown differently, and we use them differently. Sweet corn is the kind you eat as corn on the cob, "niblets," etc. It's a starchy vegetable like peas or potatoes. Nutritionally, I personally would count it as a veggie maybe once a week, and as a starch if I ate it more often.
Dent corn is a grain. You can't just eat it; it has to be ground into cornmeal and/or treated with alkali to make it digestible. That's what's used to make tortillas, tamales, cornbread, cornflakes, and so on. You would definitely count that as a grain/flour product. (Hominy/pozole is processed dent corn.)
There's also popcorn, which is a third different plant. It's a whole grain.