Hello & welcome to the site!
The two solenoids are called the Coin Reject Electro Magnets ( CREMS for short)
they are used to reject coins that are given to the mech. when it's out of change, or when the vending price has been reached & the machine is ready to vend a bottle, but the bottle hasn't been removed yet ( so you don't over pay) or the machine is sold out ( depending on make & model of the machine it's installed in) For hobby use, it isn't necessary to have the CREMS funtional.
parts for these obsolete coinmechs are only available from parts units ( used coinmechs) the contact piece as you described are the armature & finger wires that portrude into the slug-rejector ( some call it the coin acceptor) which when the unit is de-energized will interupt the coin path through the slug rejector & cause the coin(s) to fall out into the coin-return cup,
the top CREM is usually the nickel-reject unit, while the lower CREM it used for dime/ quarter-reject.
I don't have the schematic for these particular units you have, but check the manual section & see if someone else may have posted one for your mechs.
as for cleaning, you should be able to remove the top portion (slug-rejector) by releasing the two top spring clips & tipping the unit towards you & lifting it up at a slight angle upwards. this unit can be tossed into the top rack of a dishwasher & run through a cycle to clean it, I like to prop the swinging gate assy open with a short pencil to allow the water to get into the coinpath. do not used steel wool on the coinmech, there are several magnets that will grap all of the steel whiskers & cause you grief! if it's really scuzzy, use a scotch-bright pad & lightly loosen the crud along the coinpath, do not oil any portion of the slug rejector, except (if needed) a tiny-tiney micro drop a dripless oil on the pivot-point of the little coin-craddles/axles ( these are usually made of self-lubrication bronze bushings & shouldn't need oil normally unless they don't tip/rotate freely) some folks prefer to boil the slug-rejector in a pot of boiling water, ( I don't like the idea of scalding water with a metal rejector in it myself) I also use an ultrasonic cleaner to clean my rejectors that I take in for service.
oh & if I didn't mention this, DONT use water or emerse the bottom/electronic portion of any electric coinmech, ( don't laugh, I have received many coinmechs that were dunked in water or ran through the dishwasher! hmm wonder why it doesn't work?