Yes, but cobs will take approximately forever to break down.
Banana peels aren't *quite* as bad, and will go less slowly if you chop them up first.
Unless you don't mind having large whole corncobs in your compost for the forseeable future, you might want to just dig a small hole and bury them in the ground (e.g. in an unused part of a bed), where they will a) rot down somewhat faster and b) not have to be seived out every time you want to use compost
I put them in the bottom of my worm bin. They do take forever to get eaten, but it is a nice slow meal for the wormies (especially when I go out of town).
If you don't have a worm bin yet, I highly recommend them! Not only are the castings great for your garden, it keeps a ton of organic waste out of our landfills (and cuts down on disease/animals eating fro our dumps and getting sick,passing illness on etc).
Google it-pretty interesting stuff. I read somewhere that almost 60% of our trash is organic. Imagine if we let the wormies take care of it and put the good stuff back inthe ground instead of polluting it...
If you're interested, over on www.SufficientSelf.com (a sister site to this one) miss_thenorth has posted a neat recipe for boiling up 'used' cobs with some water and sugar to make corn syrup.
They could still be composted afterwards, and actually she says the chickens even still like them as an intermediate step