Did they see them as strange small less intelligent humans? Or did they properly recognize them as a type of animal completely separate from mankind? Did racism play any role in how they saw them?
I can only speak for the Greeks and Romans, who recognized the intelligence of primates, but still regarded them very much as animals. Racism (as least in the pseudo-scientific nineteenth-century sense) seems to have played no part in their assessments, or indeed in their worldview (on this, see Benjamin Issac, The Invention of Racism in Classical Antiquity).
In his Natural History, Pliny the Elder comments both on the intelligence of apes and on their sometimes human-like behavior. For example:
"All the species of apes manifest remarkable affection for their offspring. Females, which have been domesticated, and have had young ones, carry them about and shew them to all comers, shew great delight when they are caressed, and appear to understand the kindness thus shown them." (HN, 8.80)
Aelian notes repeatedly that monkeys can learn to imitate such human skills as dancing, pipe-playing and (more dubiously) chariot-driving (5.26, 7.21, 17.25).
It seems, in short, that the Greeks and Romans saw primates as nothing more or less than remarkably intelligent animals.