and a company can demand that a certain device takes the EMC compliance test
No, this is (sadly) not mandatory except for specialized applications - cars and equipment used in cars for example. The only thing someone can demand is that you demonstrate how you comply with the relevant EU Directives through documentation and the EC Declaration of Conformity ("CE Declaration"). Directives like EMC and RED in turn offer different alternatives for this, where one of them is assessment by a notified body (approved test house).
Also, some random generic "company" cannot demand anything out of anyone.
If it does not pass the test, the company can pursue the manufacturer.
Only if the manufacturer has made a claim that the device is compliant but it isn't. Generally some generic "company" has no particular rights - if a device is found non-compliant they can bring it up with the relevant supervising authorities in the specific country. The authorities can then demand that you give them access to your technical file - that is, all technical documentation demonstrating how a product is compliant.
If found non-compliant, then the authorities could force the product to be withdrawn from the market and they could hand out fines. Whether or not lawsuit stuff between companies can happen, that would mostly depend on national law & such discussions belong on https://law.stackexchange.com/
So, our clients can put the CE logo onto their devices without passing any test ?
Here's an example from the RED (radio) directive article 12 regarding obligations of importers (EMC LVD etc directives will have similar text), emphasis mine:
Before placing radio equipment on the market importers shall ensure that the appropriate conformity assessment procedure referred to in Article 17 has been carried out by the manufacturer and that the radio equipment is so constructed that it can be operated in at least one Member State without infringing applicable requirements on the use of radio spectrum. They shall ensure that the manufacturer has drawn up the technical documentation, that the radio equipment bears the CE marking and is accompanied by the information and documents referred to in Article 10(8), (9) and (10), and that the manufacturer has complied with the requirements set out in Article 10(6) and (7).
So the person who puts a product on the European market may CE mark it and it is then their responsibility to ensure that the product is compliant and that the relevant technical documentation is available. Basically the company who puts an item on the market is always the one juridically responsible. Unless of course the manufacturer has claimed compliance but the products don't fulfil it.
Isn't it strange ?
Yes, CE marking is a product of bureaucracy, not of engineering, with little or no relevance to how safe/suitable a product actually is. The whole procedure is a joke and legal consequences typically only happen after some incident has happened. So from a consumer's perspective, the CE mark doesn't mean anything.
Basically EU thinks that free trade is more important than that products sold in the union are safe and proven suitable for use. For example, most counties before they joined EU had national requirements that every single electronics product had to pass 3rd party testing and approval before it could be placed on the market. EU considers this a "trade obstacle" so counties have to drop such requirements before joining the union.
If a device passes the EMC compliance test, does it mean that the CE-marking can be put onto it, or does it need other tests ?
Generally yes, but it depends on what type of product it is. There are lots of specific product safety standards.
There's LVD, EMC, RED, RoHS directives which are most relevant to electronics, but other product-specific directives may apply too. You don't test for compliance of the directives though, you test for compliance with the relevant "harmonized" standards listed under each directive, in case they apply to your specific product.
Who is responsible if the EMC compliance test fails after the device was sold: the company that designed the card or the client that commercializes it, or both?
See the importer example above.
Generally, who takes the EMC compliance test and who pays for it? The company that designed the card or the client? Is it a good practice for the designer to always ensure that the EMC compliance test is passed by the client?
Whoever feels like forking up the cash. That's a business decision.
Generally speaking, you'll want any electronics product you design to comply with both EU and FCC technical standards. That goes a long way in selling it anywhere around the world. Of course there may always be national requirements, but it usually boils down to the same technical standards.