Is there any example or existing resource for using matlab in audio comparison (cross correlation)?
Your problem is known as "robust audio fingerprinting", and cross-correlation is not useful for solving it:


Cross-correlation is computationally expensive for a full-length signal. Not to mention matching a collection of thousands (or even millions in industrial applications) of audio files.
Your recorded signal B will be different enough from A (additional room noise and reverberation, loss of low and high frequencies) that the raw waveforms will poorly match.


The most common approach for solving this problem on music signals (eg as used by Shazam) is to extract "landmarks" in the spectrogram, which are sharp increases in energy at a specific time/frequency point; and to hash these. Landmark extraction reduces the amount of data to process (from >10k samples per second to 50 or so data points per second), makes the extraction process robust to noise, and yields a data-representation fast to search since it can be quantized and hashed. Matlab implementation here. You have not mentioned what kind of content your audio files have; this technique might not always work for other types of content than music.