It depends on the wording of the contract...if you just sign a boilerplate work-for-hire, then you'll have problems claiming the characters you contributed to the overall work.
You can try to make adjustments to it if the publisher is amenable, but most of the time the monoliths like DC and Marvel wouldn't be inclined, unless you have a bankable, "marquee value" name...and even then you might have problems.
But let me add this--if you don't have a contract that SPECIFICALLY addresses all the issues of ownership and copyright transfer, then whatever you bring to the work is legally your intellectual property.
And this all has to be laid out in a written instrument...as the old axiom goes about copyright law-"A verbal agreement isn't worth the paper it's printed on."
It has to be in writing and it has to be spelled out S-P-E-C-I-F-I-C-A-L-L-Y.
As far as the western Ghost Rider character is concerned, you're absolutely right. Marvel picked up the publishing rights from the defunct Hillman (I think) in the 1960s.
A couple of years later when a question arose about their legal claim to the character and title, they very quickly slapped the Ghost Rider name on Gary Freidrich's Johnny Blaze and re-named the Western title "Night Rider."
Years later the issue was resolved and they ret-conned a connection between the two characters.