If I understand correctly what your questions are:
Something is a COM object based on how it is built to expose its functionality to other code that uses it. It must be built to follow certain rules and it has to provide certain functionality that is mandatory, and it must do so in a very specific way at the binary level (bits and bytes). Unfortunately, the specific rules are lengthy and too complex to explain in this answer.
There are also rules and specific binary requirements that must be obeyed by the code that uses the object.
The language independence comes from the fact that the rules are so precise and that they are designed so they are not tied to any specific language. Many languages can be used to write COM objects, and many languages can use COM objects. By which I mean that those language need to provide a mechanism for the programmer to obey those rules. That is key: the rules don't specific how the language should make it possible to obey the rules. Each language has different ways; some languages will automatically take care of a lot of details for you while others require you to do most of the work by hand. some use a special syntax just for COM, while others use the same syntax they use for everything else.
Note that "language independence" (I would call it more appropriately "language neutrality") is not the same as "language universality". Not every language can use COM.
With that in mind, your answers are:
1) How do you know if something is a COM object from reading a line of code such as those in your example?
The true answer is: "it depends on how the object was written. If it's written to obey the rules of COM and it's called via COM mechanisms in your language, then it is a COM object". In the specific case of looking at code and trying to decide if it's COM without looking at the details of the object, the answer is: "It depends on the language."
In your example code in VBScript, both are COM objects. The fact that the expression uses the Set command tells you immediately that the variables will refer to a COM object. Remember, the answer will be different in other languages (for example, even in VB6 the presence of set is not enough to know if the object is a COM object).
2) How is the language independence achieved?
It is achieved by the use of strict rules at the binary level. Different languages comply with the rules different ways and that is OK. Some languages cannot comply with those rules, and they so not support COM.
Those specific objects you show have their own functionality and yes, they work through functions and properties; those are some of the rules. If a language doesn't have a mechanism that allows you to call those functions, then that language cannot be used to use COM objects.
If you want to learn the rules, they are usually expressed in C or C++, and one of the best books on the subject is "Essential COM" by Don Box.