user4918: I have connected mc to a pc using USB. I need data on hyperterminal through serial to USB connection, hence I connected TX, RX and gnd pins of the Leonardo to the rs232 pins and one other side of rs232 to USB to pc. However, the data is still transmitting on serial monitor, but not on hyperterminal.
int count = 0;

void setup() {
  Serial.begin(9600);
  pinMode(3,INPUT); // This is the pin to which we have connected the button
  attachInterrupt(0, IRsensor, CHANGE);
}

void loop() {
  if (Serial.available()) {
    /* read the most recent byte */
    /*ECHO the value that was read, back to the serial port. */
    Serial.write(count);
  }
}

void IRsensor() {
  if(digitalRead(3) == 1) {
    count++;
    Serial.println(count);
  }
}


user3866: To be sure, please add code.
You can use usb on Arduino to communicate with pc. You don't need RS232/USB converter. Just open hyperterminal with the port of arduino. Arduino port can be found in:

Arduino IDE Tools>Port
My Computer>Properties>Device manager>Ports

If you really need SoftwareSerial then connect Rx,Tx and don't forget GND! 
UPDATE
To communicate with RS232/USB converter you have to add RS232/TTL converter to Arduino side. The schematic would look like PC <-> USB/RS232 <-> RS232/TTL <-> Arduino:

PC - your computer
USB/RS232 to convert from usb to RS232. On RS232 side the voltage is -5V to +5V
MAX232 RS232/TTL. To convert the voltage
Arduino - your MCU

UPDATE 2
As i said, connect your arduino to PC like you do while programming.

Next, upload this sketch:
void setup() {
  Serial.begin(9600);
}

void loop() {
  if(Serial.available()){
   Serial.print("\nReceived: ");
   Serial.write(Serial.read());
  }
}

Open HyperTerminal: choose port with Arduino, 

Connect to arduino, Serial Monitor has to be closed


4918: <p>I have connected mc to a pc using USB. I need data on hyperterminal through serial to USB connection, hence I connected TX, RX and gnd pins of the Leonardo to the rs232 pins and one other side of rs232 to USB to pc. However, the data is still transmitting on serial monitor, but not on hyperterminal.</p>

<pre><code>int count = 0;

void setup() {
  Serial.begin(9600);
  pinMode(3,INPUT); // This is the pin to which we have connected the button
  attachInterrupt(0, IRsensor, CHANGE);
}

void loop() {
  if (Serial.available()) {
    /* read the most recent byte */
    /*ECHO the value that was read, back to the serial port. */
    Serial.write(count);
  }
}

void IRsensor() {
  if(digitalRead(3) == 1) {
    count++;
    Serial.println(count);
  }
}
</code></pre>
 3866: <p>To be sure, please add code.</p>

<p>You can use usb on Arduino to communicate with pc. You don't need RS232/USB converter. Just open hyperterminal with the port of arduino. Arduino port can be found in:</p>

<ol>
<li>Arduino IDE Tools>Port</li>
<li>My Computer>Properties>Device manager>Ports</li>
</ol>

<p>If you really need <code>SoftwareSerial</code> then connect Rx,Tx and don't forget GND! </p>

<p><strong>UPDATE</strong></p>

<p>To communicate with RS232/USB converter you have to add RS232/TTL converter to Arduino side. The schematic would look like PC &lt;-> USB/RS232 &lt;-> RS232/TTL &lt;-> Arduino:</p>

<ol>
<li>PC - your computer</li>
<li><a href="https://www.sparkfun.com/products/11304" rel="nofollow noreferrer">USB/RS232</a> to convert from usb to RS232. On RS232 side the voltage is -5V to +5V</li>
<li><a href="http://www.ti.com/lit/ds/symlink/max232.pdf" rel="nofollow noreferrer">MAX232</a> RS232/TTL. To convert the voltage</li>
<li>Arduino - your MCU</li>
</ol>

<p><strong>UPDATE 2</strong></p>

<p>As i said, connect your arduino to PC like you do while programming.</p>

<p><img src="https://i.stack.imgur.com/PG9JV.jpg" alt="enter image description here">
Next, upload this sketch:</p>

<pre><code>void setup() {
  Serial.begin(9600);
}

void loop() {
  if(Serial.available()){
   Serial.print("\nReceived: ");
   Serial.write(Serial.read());
  }
}
</code></pre>

<p>Open HyperTerminal: choose port with Arduino, </p>

<p><img src="https://i.stack.imgur.com/fA2Pp.png" alt="enter image description here"></p>

<p>Connect to arduino, <strong>Serial Monitor has to be closed</strong></p>

<p><img src="https://i.stack.imgur.com/L1moo.png" alt="enter image description here"></p>
