Just tried in VS 2013 and VS 2015. They did validate key/refkey now. It showed up warnings at the parent level though.
But as @antiduh said, they still do not check xsd file. So you really need to make sure the key/refkey in xsd is correct.
It took my hours to figure out a simple sample. Even the sample on MSDN does not work. I had to modify it a little bit.
First, make sure you know how to let Visual Studio validate an xml against an xsd of your choice.
Then use the following sample xsd and xml for key/refkey validation. Mind that the warning is on the closing of root element, instead of on the element that violates the key/ref rule.
The xsd file looks like this:
<?xml version="1.0" encoding="utf-8"?>
<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="namespace1"
xmlns:r="namespace1"
elementFormDefault="qualified">
<xs:element name="root">
<xs:complexType>
<xs:sequence>
<xs:element name="A" type="r:A" maxOccurs="unbounded"/>
<xs:element name="B" type="r:B"/>
</xs:sequence>
</xs:complexType>
<xs:keyref name="dummy" refer="r:pNumKey">
<xs:selector xpath="r:A/r:part"/>
<xs:field xpath="@ref-number"/>
</xs:keyref>
<xs:key name="pNumKey">
<xs:selector xpath="r:B/r:part"/>
<xs:field xpath="@key-number"/>
</xs:key>
</xs:element>
<xs:complexType name="A">
<xs:sequence>
<xs:element name="part" maxOccurs="unbounded">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="ref-number" type="xs:integer"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="B">
<xs:sequence>
<xs:element name="part" maxOccurs="unbounded">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="key-number" type="xs:integer"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:schema>
And the xml file looks like this:
<?xml version="1.0" encoding="utf-8" ?>
<root xmlns="namespace1">
<A>
<!-- if the ref-number is equal to one of the key-number, the validation will pass -->
<part ref-number="1"/>
</A>
<A>
<!-- if the ref-number is not equal to one of the key-number, the validation will give error -->
<part ref-number="5"/>
</A>
<B>
<part key-number="1"/>
<part key-number="2"/>
<part key-number="3"/>
</B>
</root><!--you will see warnings here-->